package BanyuanClub.Study.Day0305;

import java.io.File;

public class PrientFile {
    public static void query(File file,int start) {
        for (int i = 0; i < start; i++) {
            System.out.print(" ");
        }
        if (file.isDirectory()){
            System.out.print("*");
        }else {
            System.out.print("-");
        }
        System.out.println(file.getName());
        if (file.isDirectory()){
            File[] files = file.listFiles();
            for (File file1:files) {
                query(file1,start+1);
            }
        }
    }

    public static void main(String[] args) {
        File file = new File("/Users/edz");
        int start = 0;
        PrientFile.query(file,start);
    }
}
